<?

  if ($_REQUEST['usermodel'] == 'login')
  {
    if ($this->login($_REQUEST['usr-email'], $_REQUEST['usr-password']))
    {
      AGController::redirect($_REQUEST['action'], $_REQUEST['controller']);
    }
    else
    {
      logError('Error logging on! Please check your username and password. ');
    }
  }

  if ($this->getId()=='')
  {

?>
  <form action="?" method="post">
    
    <input type="hidden" name="controller" value="<?= $_REQUEST['controller'] ?>"/>
    <input type="hidden" name="action" value="<?= $_REQUEST['action'] ?>"/>
    <input type="hidden" name="usermodel" value="login"/>
    
    Email:<br/>
      <input style="width: 99%" type="text" name="usr-email" value=""/><br/>
    Password:<br/>
      <input style="width: 99%" type="password" name="usr-password" value=""/><br/>
  
    <input type="submit" name="login" value="log in &gt;"/>
  
  </form>

<?
  }
  
?>